<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:f="http://java.sun.com/jsf/core" 
  xmlns:p="http://primefaces.org/ui" 
  xmlns:h="http://java.sun.com/jsf/html" 
  xmlns:pr="http://java.sun.com/jsf/composite/totororo"
  template="../template_front.xhtml">
 
  <ui:define name="content">
 	<h1>Edition du Profil utilisateur</h1>
 	<div class="profil-detail">
 	
 	
 		<h:form id="profilForm" enctype="multipart/form-data" rendered="#{clientController.loggedIn}" column="1" rows="2">  
 		
		  	<div class="book-image">
			    <pr:photo elementId="#{clientController.currentClient.id}" type="client" size="avatar"/>
			</div>
			
	     	<h:outputLabel for="login" value="Login" />
	     	<p:inputText id="login" value="#{clientController.currentClient.login}" required="true" disabled="true"/>

	        <h:outputText value="Mot de passe" />
	        <p:inputText id="password" value="#{clientController.currentClient.password}" required="true" />
        	     		     	

	     	<h:outputLabel for="nom" value="Nom" />
	     	<p:inputText id="nom" value="#{clientController.currentClient.nom}" required="true" />

	     	
	     	<h:outputLabel for="prenom" value="Prenom" />
	     	<p:inputText id="prenom" value="#{clientController.currentClient.prenom}" required="true" />
	     		     	
	     	<h:outputLabel for="email" value="email" />
	     	<p:inputText id="email" value="#{clientController.currentClient.email}" required="true" />
	     	
	     	<h:outputLabel for="adresse" value="adresse" />
	     	<p:inputText id="adresse" value="#{clientController.currentClient.adresse}" required="true" />

	     	<h:outputLabel for="telephone" value="Téléphone" />
	     	<p:inputText id="telephone" value="#{clientController.currentClient.telephone}" required="true" />
	     	
	     	<h:outputLabel for="photo" value="Modifier la photo" />
			<p:fileUpload value="#{clientController.file}" mode="simple" />

		      <h:commandButton action="#{clientController.editerProfil2}" value="Enregistrer les modifications">
		      	<f:param name="clientId" value="#{clientController.currentClient.id}"/>
		      </h:commandButton> 
			     		     	
	     	<h:message for="login"></h:message>
	   		<h:messages globalOnly="true"/>
	   			   		
		</h:form>
 	</div>
  </ui:define>
</ui:composition>
